package cn.hchaojie.camp.day01;

public class DemoOperator2 {
	public static void main(String[] args) {
		boolean isMan = false;	
		
		int age = 16;
		boolean isAdult = (age >= 18);
		System.out.println(isAdult);
		
		System.out.println(!isMan);
		
		// true && true		=> true
		// true && false	=> false
		// false && true	=> false
		// false && false	=> false
		
		boolean isTall = true;
		boolean isHansome = true;
		System.out.println(isTall && isHansome);
		
		isTall = true; 
		isHansome = true;
		// true || true		=> true
		// true || false	=> true
		// false || true	=> true
		// false || false	=> false
		System.out.println(isTall || isHansome);
		
		int a = 1, b = 1;
		boolean c = (a != 1 && (++b == 2));			// && 逻辑短路
		System.out.println("b:" + b);
		System.out.println(c);
		
		boolean d = (a == 1 || (++b == 2));			// || 逻辑短路
		System.out.println(d);					// ③ 
		System.out.println(b);					// ④
		
		int kpi = 99;				// 三目运算符
		int bonus = (kpi == 100) ? 10000 : 1000;
		System.out.println(bonus);
	}
}
